#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This program is free software; you can redistribute it and/or modify  
# it under the terms of the GNU General Public License as published by  
# the Free Software Foundation; either version 2 of the License, or     
# (at your option) any later version.                                   
#                                                                         
# A copy of the license can be found in the license.txt file supplied   
# with this software or at: http://www.gnu.org/copyleft/gpl.html       
#

from id import ID

class   Entry(object) :
    def __init__(self, id, data) :
        if not isinstance(id, ID) :
            raise TypeError
        
        self._id = id
        self._data = data
        ## __init__()

    ####-----------------------------------------------------------####

    def getID(self) :
        return self._id
        ## getID()
    id = property(getID)

    def getData(self) :
        return self._data
        ## getData()
    data = property(getData)

    ####-----------------------------------------------------------####

    def __eq__(self, rhs) :
        if not instanceof(rhs, self.__class__) :
            raise TypeError

        if self.id == rhs.id and self.data == rhs.data :
            return True

        return False
        ## __eq__()

    def __str__(self) :
        return '<ENTRY id:%s data:%s>' % (str(id), str(data))
        ## __str__()

    ## class Entry

